/**
 ***********************************************************************************************************
 * Objects that perform a single rendering pass to a given render target on a given group of objects found
 * by a culler
 ***********************************************************************************************************
 * @file RBRenderPass.h
 ***********************************************************************************************************/

#ifndef __RBRENDERPASS_H__
#define __RBRENDERPASS_H__

#ifdef  HEADER_ONCE
#pragma HEADER_ONCE
#endif

#ifdef  HEADER_MSG
#pragma HEADER_MSG(RBRenderPass.h)
#endif

/***********************************************************************************************************
 * Includes
 ***********************************************************************************************************/
#include "RBRefObject.h"
#include "RBRenderTargetGroup.h"
#include "RBRenderer.h"
#include "RBVector.h"
#include "RBViewport.h"

/***********************************************************************************************************
 * Forward declarations
 ***********************************************************************************************************/
typedef std::vector< RBHandle<RBGeometry> > RBGeometryArray;
class RBVisibilityManager;

/***********************************************************************************************************
 * Classes
 ***********************************************************************************************************/

namespace rb_render_pass
{

    void collect_geometries			(RBGeometryArray* output, RBCamera* camera, RBVisibilityManager* scene);
    void open_render_target_group	(RBRenderer* pRenderer, RBRenderTargetGroup* pRenderTargetGroup, uint32 clearFlags = 0xFFFFFFFF, const RBColorA& clearColor = RBColorA(1,1,1,0), float32 clearDepth = -1.0f,
									 float32 x = 0.0f, float32 y = 0.0f, float32 width = 1.0f, float32 height = 1.0f, float32 zMin = 0.0f, float32 zMax = 1.0f);
    void render_geometries          (RBRenderer* pRenderer, const RBGeometryArray& aVisibleGeometries, RBCamera* camera);

    void PushTechniques      (const RBGeometryArray& vGeometries, std::vector<RBEffect*>& vEffects, RBEffect* pEffect);
    void PopTechniques       (const RBGeometryArray& vGeometries, const std::vector<RBEffect*>& vEffects);

};

/***********************************************************************************************************/

#endif // __RBRENDERPASS_H__
